home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / POV-Ray 3.0.2 / src / SOURCE / PRISM.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-30  |  3.5 KB  |  111 lines  |  [TEXT/CWIE]

  1. /****************************************************************************
  2. *                   prism.h
  3. *
  4. *  This module contains all defines, typedefs, and prototypes for PRISM.C.
  5. *
  6. *  from Persistence of Vision(tm) Ray Tracer
  7. *  Copyright 1996 Persistence of Vision Team
  8. *---------------------------------------------------------------------------
  9. *  NOTICE: This source code file is provided so that users may experiment
  10. *  with enhancements to POV-Ray and to port the software to platforms other
  11. *  than those supported by the POV-Ray Team.  There are strict rules under
  12. *  which you are permitted to use this file.  The rules are in the file
  13. *  named POVLEGAL.DOC which should be distributed with this file. If
  14. *  POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  15. *  Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  16. *  Forum.  The latest version of POV-Ray may be found there as well.
  17. *
  18. * This program is based on the popular DKB raytracer version 2.12.
  19. * DKBTrace was originally written by David K. Buck.
  20. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  21. *
  22. *****************************************************************************/
  23.  
  24.  
  25. #ifndef PRISM_H
  26. #define PRISM_H
  27.  
  28.  
  29.  
  30. /*****************************************************************************
  31. * Global preprocessor definitions
  32. ******************************************************************************/
  33.  
  34. #define PRISM_OBJECT (STURM_OK_OBJECT)
  35.  
  36. #define LINEAR_SPLINE    1
  37. #define QUADRATIC_SPLINE 2
  38. #define CUBIC_SPLINE     3
  39.  
  40. #define LINEAR_SWEEP 1
  41. #define CONIC_SWEEP  2
  42.  
  43. /* Generate additional prism statistics. */
  44.  
  45. #define PRISM_EXTRA_STATS 1
  46.  
  47.  
  48.  
  49. /*****************************************************************************
  50. * Global typedefs
  51. ******************************************************************************/
  52.  
  53. typedef struct Prism_Struct PRISM;
  54. typedef struct Prism_Spline_Struct PRISM_SPLINE;
  55. typedef struct Prism_Spline_Entry_Struct PRISM_SPLINE_ENTRY;
  56. typedef struct Prism_Intersection_Structure PRISM_INT;
  57.  
  58. struct Prism_Intersection_Structure
  59. {
  60.   DBL d;  /* Distance of intersection point                  */
  61.   DBL w;  /* Paramter of intersection point on n-th spline   */
  62.   int n;  /* Number of segment hit                           */
  63.   int t;  /* Type of intersection: base/cap plane or segment */
  64. };
  65.  
  66. struct Prism_Spline_Entry_Struct
  67. {
  68.   DBL x1, y1, x2, y2;  /* Min./Max. coordinates of segment   */
  69.   UV_VECT A, B, C, D;  /* Coefficients of segment            */
  70. };
  71.  
  72. struct Prism_Spline_Struct
  73. {
  74.   int References;
  75.   PRISM_SPLINE_ENTRY *Entry;
  76. };
  77.  
  78. struct Prism_Struct
  79. {
  80.   OBJECT_FIELDS
  81.   int Number;
  82.   int Spline_Type;          /* Spline type (linear, quadratic ...)        */
  83.   int Sweep_Type;           /* Sweep type (linear, conic)                 */
  84.   TRANSFORM *Trans;
  85.   DBL Height1, Height2;
  86.   DBL x1, y1, x2, y2;       /* Overall bounding rectangle of spline curve */
  87.   PRISM_SPLINE *Spline;     /* Pointer to array of splines                */
  88.   PRISM_INT *Intersections; /* Prism intersections list                   */
  89. };
  90.  
  91.  
  92.  
  93. /*****************************************************************************
  94. * Global variables
  95. ******************************************************************************/
  96.  
  97.  
  98.  
  99.  
  100. /*****************************************************************************
  101. * Global functions
  102. ******************************************************************************/
  103.  
  104. PRISM *Create_Prism PARAMS((void));
  105. void  Compute_Prism_BBox PARAMS((PRISM *Prism));
  106. void  Compute_Prism PARAMS((PRISM *Prism, UV_VECT *P));
  107.  
  108.  
  109.  
  110. #endif
  111.